package model

type MiaoClient struct {
	DeviceID        int64  `json:"deviceID,string,omitempty" gorm:"primaryKey;comment:'设备id'"`
	BiosSerial      string `json:"biosSerial" gorm:"comment:'bios序列号'"` // bios序列号
	MainBoardSerial string `json:"mainBoardSerial,omitempty" gorm:"comment:'主板序列号'"`
	HardDiskSerial  string `json:"hardDiskSerial,omitempty"`
	ActiveMAC       string `json:"activeMAC,omitempty" gorm:"column:active_mac"`
	IP              string `json:"ip,omitempty"`
	Hostname        string `json:"hostname,omitempty"`
	CreatedAt       int64  `json:"createdAt,string"`
	IsOverlap       bool   `json:"isOverlap,omitempty" gorm:"comment:'设备信息是否存在重复的可能'"`
}

func (r *MiaoClient) TableName() string {
	return "miao_client"
}

type SearchDevice struct {
	PageInfo
	IP       string `json:"ip" form:"ip"`
	Hostname string `json:"hostname" form:"hostname"`
}

// DeviceDetail 设备详情信息，后续有其他关联扩展字段都添加到这个结构体中
type DeviceDetail struct {
	Client   MiaoClient `json:"client"`
	IsOnline bool       `json:"isOnline"`
}
